package com.example.rocketmq.controller;

import com.example.rocketmq.springboot_test.SpringBootProducer;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("/mq")
public class MQController {

    @Resource
    private SpringBootProducer producer;

    @ResponseBody
    @PostMapping("/send-message")
    public String sendMessage(@RequestParam("message") String message) {
        producer.sendMessage(message);
        return "SUCCESS";
    }
}
